package org.dna.wicketui;

import junit.framework.TestCase;

import org.apache.wicket.util.tester.FormTester;
import org.apache.wicket.util.tester.WicketTester;
import org.dna.MetroApplication;
import org.dna.wickwtui.LoginPage;

public class MetroTestCase extends TestCase {
	
	protected WicketTester tester;
	protected MetroApplication app;

	@Override
	public void setUp() {
		app = new MetroApplication();
		tester = new WicketTester(app);
	}
	
	protected void doLoginAdmin() {
		// assert rendered page class
		tester.assertRenderedPage(LoginPage.class);

		FormTester loginFormTester = tester.newFormTester("form");
		loginFormTester.setValue("metroUsername", "admin");
		loginFormTester.setValue("metroPassword", "admin");
		loginFormTester.submit();
	}


}
